<%--
  Created by IntelliJ IDEA.
  User: 大帅
  Date: 2025/7/18
  Time: 18:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>编辑用户</title>
</head>
<style>
    body {
        font-family: Arial, sans-serif;
        background-color: #f4f4f4;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 100vh;
    }

    .form-container {
        background-color: #fff;
        padding: 30px 40px;
        border-radius: 8px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        width: 300px;
    }

    .form-container h2 {
        text-align: center;
        margin-bottom: 20px;
    }

    table {
        width: 100%;
        border-collapse: collapse;
    }

    td {
        padding: 8px 0;
    }

    input[type="text"] {
        width: 100%;
        padding: 8px;
        margin-top: 2px;
        margin-bottom: 10px;
        border: 1px solid #ccc;
        border-radius: 4px;
    }

    input[type="submit"] {
        width: 70%;
        padding: 10px;
        background-color: #007BFF;
        color: white;
        border: none;
        border-radius: 4px;
        font-size: 16px;
        cursor: pointer;
    }

    input[type="submit"]:hover {
        background-color: #0056b3;
    }

    .gender-select {
        width: 100%;
        padding: 8px;
        margin-top: 2px;
        margin-bottom: 10px;
        border: 1px solid #ccc;
        border-radius: 4px;
        background-color: #fff;
        font-size: 14px;
    }

    .gender-select:focus {
        border-color: #007BFF;
        outline: none;
        box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    }
</style>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<body>
<div class="form-container">
    <h2>添加用户</h2>
    <form action="/app/api/edit?method=edit&id=<%=request.getParameter("id")%>" method="post">
        <table>
            <tr>
                <td>姓名：</td>
                <td><input type="text" name="name" value="${stu.getName()}"></td>
            </tr>
            <tr>
                <td>年龄：</td>
                <td><input type="text" name="age" value="${stu.getAge()}"></td>
            </tr>
            <tr>
                <td>性别：</td>
                <td>
                    <select name="sex" class="gender-select">
                        <option value="男" ${stu.getSex() == '男' ? 'selected' : ''}>男</option>
                        <option value="女" ${stu.getSex() == '女' ? 'selected' : ''}>女</option>
                    </select>

                </td>
            </tr>

            <tr>
                <td colspan="2" align="center"><input type="submit" value="提交"></td>
            </tr>
        </table>
    </form>
</div>
</body>
</html>
